#ifndef _RETRO_SCRIPTEDITOR
#define _RETRO_SCRIPTEDITOR

namespace Retro
{
  namespace Creator
  {
    namespace Editor
    {
      class ScriptEditor : public EditorBase
      {
      private:
        Scripting::ScriptManager* mManager;
        WrapWnd       mEdit;
        LayoutElement mLayout;

      protected:
        virtual VOID  onCreate(Event::WndCreateEvent& iEvent);
        virtual VOID  onDestroy();
        virtual VOID  onNotify(Event::NotifyEvent& iEvent);
        virtual VOID  onSize(Event::SizeEvent& iEvent);
        virtual VOID  onToolbar(ToolBarNotify* iData);
        virtual VOID  onFocus(Event::FocusEvent& iEvent);

        virtual VOID  clearUndo();
        virtual VOID  initToolbar();

      public:
        BOOL  validateSyntax();

        virtual VOID  setResource(Data::Resource* iValue);

        INL Data::Script* getScript()
        {
          return (Data::Script*)getResource();
        }

        virtual VOID  setZoom(INT value);
        virtual INT   getZoom();

        virtual INT   getLineSize();

        virtual BOOL  canUndo();
        virtual BOOL  canRedo();
        virtual BOOL  undo();
        virtual BOOL  redo();
        virtual BOOL  save(HANDLE iFile);
        virtual VOID  flush(Data::Resource* oResource);

        ScriptEditor();
      };
    } // namespace Editor
  } // namespace Creator
} // namespace Retro

#endif
